<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of con_permiso
 *
 * @author Luisao
 */
class con_permiso extends CI_Model {
    
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_all()
    {
        $this->db->select();
        $query = $this->db->get('con_permiso');
        return $query;
    }  
    
    function get_permiso($id_modulo,$id_perfil){
        $this->db->select();
        $this->db->from('con_permiso');
        $this->db->join('con_submodulo','con_permiso.id_submodulo = con_submodulo.id_submodulo');
        $this->db->where('id_perfil',$id_perfil);
        $this->db->where('con_submodulo.id_modulo',$id_modulo);
        $query = $this->db->get();
        
        $count = $query->num_rows();
        
        if($count>0){
            return true;
        }else{
            return false;
        }
        
    }
}
?>
